<%@page import="bean.Admin"%>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
        <!DOCTYPE html>
        <html>
        <%
	Admin admin = (Admin) session.getAttribute("admin");
%>

            <head>
                <meta charset="utf-8">
                <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
                <title>新闻发布系统</title>
                <link rel="stylesheet" href="../css/layui.css">
                <link rel="stylesheet" href="../css/admin.css">
                <link rel="icon" href="../img/icon.png" type="image/x-icon">
            </head>

            <body class="layui-layout-body">
                <div class="layui-layout layui-layout-admin">
                    <div class="layui-header">
                        <div class="layui-logo">新闻发布系统</div>
                        <!-- 头部区域（可配合layui已有的水平导航） -->
                        <ul class="layui-nav layui-layout-left">
                            <li class="layui-nav-item layui-this" data-nav="1"><a href="javascript:;">新闻列表</a></li>
                        </ul>
                        <ul class="layui-nav layui-layout-right">
                        <%if (admin != null) {%>
                            <li class="layui-nav-item">
                                <a href="javascript:;"> <img src="../img/logins.png" class="layui-nav-img">
                                        <%=admin.getName()%>
                                </a>
                            </li>
                            <li class="layui-nav-item"><a href="/News/Logout">注销账号</a></li>
                            <%}%>
                            <li class="layui-nav-item"><a href="../index.html">首页</a></li>
                        </ul>
                    </div>
                    <div class="layui-side layui-bg-black">
                        <div class="layui-side-scroll" id="layui_nav_left_1">
                            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                                <li class="layui-nav-item layui-nav-itemed">
                                    <dl class="layui-nav-child">
                                        <dd>
                                            <a href="javascript:;" data-url="./news/newsList.jsp">全部新闻</a>
                                        </dd>
<%--                                        <%if (admin!=null&&admin.getAdmin() == true|| admin==null) {%>--%>
                                        <dd>
                                            <a href="javascript:;" data-url="/News/IsLogin">管理新闻</a>
                                        </dd>
<%--                                        <%}%>--%>
                                        <%if (admin!=null&&admin.getAdmin() == true) {%>
                                        <dd>
                                            <a href="javascript:;" data-url="./manage/usersList.jsp">用户管理</a>
                                        </dd>
                                        <%}%>
                                    </dl>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <div class="layui-body" id="LAY_app_body">
                        <div class="layui-tabsbody-item layui-show">
                            <%if(admin!=null){%>
                            <iframe src="./news/newsList.jsp" frameborder="0" class="layui-iframe" style="padding: 15px;"></iframe>
                            <%
                                }
                            if(admin==null){
                            %>
                            <iframe src="./login.jsp" frameborder="0" class="layui-iframe" style="padding: 15px;"></iframe>
                           <%}%>

                        </div>
                    </div>
                    <%
			if (admin != null) {
		%>
                        <div class="layui-footer">
                            <!-- 底部固定区域 -->
                            © 新闻发布后台管理
                        </div>
                        <%
			}
		%>
                </div>
                <script src="../js/jquery-3.4.1.min.js"></script>
                <script src="../js/layui.js"></script>
                <script src="../js/admin.js"></script>
            </body>

        </html>